Translatable

interface Translatable

Classes that implement Translatable can be automatically utilized by many FzzyConfig systems for generating translatable text in-game

Author

fzzyhmstrs

Since

0.2.0

Samples

import me.fzzyhmstrs.fzzy_config.util.Translatable

fun main() { 
   //sampleStart 
   class ExampleTranslatable: Translatable {
    override fun translationKey(): String {
        return "my.config.cool.translation"
    }

    override fun descriptionKey(): String {
        return "my.config.cool.translation.desc"
    }
} 
   //sampleEnd
}

Inheritors

Functions

Link copied to clipboard
open fun description(fallback: String? = null): MutableText

The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered.

Link copied to clipboard
abstract fun descriptionKey(): String

translation key of this Translatable's description. the "description" in-game, the descriptions Enchantment Descriptions adds to enchantment tooltips are a good example.

Link copied to clipboard

Whether this Translatable has a valid description

Link copied to clipboard

Whether this Translatable has a valid translation

Link copied to clipboard
open fun translation(fallback: String? = null): MutableText

The translated Text name from the translationKey. Falls back to the implementing classes Simple Name (non-translated)

Link copied to clipboard
abstract fun translationKey(): String

translation key of this Translatable. the "name" in-game